﻿
@{
    ViewBag.Title = "Op";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>实现对pdf、word、excel、ppt四种文件的读取显示，读取text.txt另存为pdf、word、excel、ppt四种格式文件。</h2>


<form id="ff" action="~/Handler1.ashx?type=pdf" method="post" target="_blank">
   

</form>
<button id="btnSaveAsPDF" class="btn btn-default" type="submit">pdf</button>
<button id="btnSaveAsWord" class="btn btn-default" type="submit">word</button>
<button id="btnSaveAsExcel" class="btn btn-default" type="submit">excel</button>
<button id="btnSaveAsPPT" class="btn btn-default" type="submit">ppt</button>
@section  myscripts{
<script src="~/Content/jquery.form.js"></script>
    <script>
        $(function () {
            $('#btnSaveAsPDF').click(function () {
                window.location.href = '/Handler1.ashx?type=pdf';
            });
            $('#btnSaveAsExcel').click(function () {
                window.location.href = '/Handler1.ashx?type=xls';
            });
        });

    </script>
}